package com.boot;

import com.boot.config.UpConfig3;
import com.boot.config.UpConfig4;
import com.boot.domain.Car3;
import com.boot.domain.Car4;
import org.springframework.boot.SpringApplication;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * @author
 * @date 2025-07-28
 * @Description 测试  获取配置信息
 */
public class MainApplicatio4 {
    public static void main(String[] args) {
        // 启动springboot 项目 必须指定一个配置 不一定就是当前类
        ConfigurableApplicationContext applicationContext = SpringApplication.run(UpConfig4.class, args);
        System.out.println("--------------------------------------");
        Car4 car = (Car4) applicationContext.getBean("car4-com.boot.domain.Car4"); // 加载car4时，bean的名字默认是Car4上ConfigurationProperties指定的前缀+'-'+类全名
        System.out.println(car);
    }
}
